Optimal. Leaf size=92 \[ -\frac {a \log (\cos (e+f x))}{f}-\frac {a \sec ^2(e+f x)}{f}+\frac {b \sec ^3(e+f x)}{3 f}+\frac {a \sec ^4(e+f x)}{4 f}-\frac {2 b \sec ^5(e+f x)}{5 f}+\frac {b \sec ^7(e+f x)}{7 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 92, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {4223, 1816}
\begin {gather*} \frac {a \sec ^4(e+f x)}{4 f}-\frac {a \sec ^2(e+f x)}{f}-\frac {a \log (\cos (e+f x))}{f}+\frac {b \sec ^7(e+f x)}{7 f}-\frac {2 b \sec ^5(e+f x)}{5 f}+\frac {b \sec ^3(e+f x)}{3 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 1816
Rule 4223
Rubi steps
\begin {align*} \int \left (a+b \sec ^3(e+f x)\right ) \tan ^5(e+f x) \, dx &=-\frac {\text {Subst}\left (\int \frac {\left (1-x^2\right )^2 \left (b+a x^3\right )}{x^8} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {\text {Subst}\left (\int \left (\frac {b}{x^8}-\frac {2 b}{x^6}+\frac {a}{x^5}+\frac {b}{x^4}-\frac {2 a}{x^3}+\frac {a}{x}\right ) \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {a \log (\cos (e+f x))}{f}-\frac {a \sec ^2(e+f x)}{f}+\frac {b \sec ^3(e+f x)}{3 f}+\frac {a \sec ^4(e+f x)}{4 f}-\frac {2 b \sec ^5(e+f x)}{5 f}+\frac {b \sec ^7(e+f x)}{7 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.30, size = 87, normalized size = 0.95 \begin {gather*} \frac {b \sec ^3(e+f x)}{3 f}-\frac {2 b \sec ^5(e+f x)}{5 f}+\frac {b \sec ^7(e+f x)}{7 f}-\frac {a \left (4 \log (\cos (e+f x))+2 \tan ^2(e+f x)-\tan ^4(e+f x)\right )}{4 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 141, normalized size = 1.53
method | result | size |
derivativedivides | \(\frac {a \left (\frac {\left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {\left (\tan ^{2}\left (f x +e \right )\right )}{2}-\ln \left (\cos \left (f x +e \right )\right )\right )+b \left (\frac {\sin ^{6}\left (f x +e \right )}{7 \cos \left (f x +e \right )^{7}}+\frac {\sin ^{6}\left (f x +e \right )}{35 \cos \left (f x +e \right )^{5}}-\frac {\sin ^{6}\left (f x +e \right )}{105 \cos \left (f x +e \right )^{3}}+\frac {\sin ^{6}\left (f x +e \right )}{35 \cos \left (f x +e \right )}+\frac {\left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )}{35}\right )}{f}\) | \(141\) |
default | \(\frac {a \left (\frac {\left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {\left (\tan ^{2}\left (f x +e \right )\right )}{2}-\ln \left (\cos \left (f x +e \right )\right )\right )+b \left (\frac {\sin ^{6}\left (f x +e \right )}{7 \cos \left (f x +e \right )^{7}}+\frac {\sin ^{6}\left (f x +e \right )}{35 \cos \left (f x +e \right )^{5}}-\frac {\sin ^{6}\left (f x +e \right )}{105 \cos \left (f x +e \right )^{3}}+\frac {\sin ^{6}\left (f x +e \right )}{35 \cos \left (f x +e \right )}+\frac {\left (\frac {8}{3}+\sin ^{4}\left (f x +e \right )+\frac {4 \left (\sin ^{2}\left (f x +e \right )\right )}{3}\right ) \cos \left (f x +e \right )}{35}\right )}{f}\) | \(141\) |
risch | \(i a x +\frac {2 i a e}{f}-\frac {4 \left (105 a \,{\mathrm e}^{12 i \left (f x +e \right )}-70 b \,{\mathrm e}^{11 i \left (f x +e \right )}+420 a \,{\mathrm e}^{10 i \left (f x +e \right )}+56 b \,{\mathrm e}^{9 i \left (f x +e \right )}+735 a \,{\mathrm e}^{8 i \left (f x +e \right )}-228 b \,{\mathrm e}^{7 i \left (f x +e \right )}+735 a \,{\mathrm e}^{6 i \left (f x +e \right )}+56 b \,{\mathrm e}^{5 i \left (f x +e \right )}+420 a \,{\mathrm e}^{4 i \left (f x +e \right )}-70 b \,{\mathrm e}^{3 i \left (f x +e \right )}+105 a \,{\mathrm e}^{2 i \left (f x +e \right )}\right )}{105 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{7}}-\frac {a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{f}\) | \(184\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 79, normalized size = 0.86 \begin {gather*} -\frac {420 \, a \log \left (\cos \left (f x + e\right )\right ) + \frac {420 \, a \cos \left (f x + e\right )^{5} - 140 \, b \cos \left (f x + e\right )^{4} - 105 \, a \cos \left (f x + e\right )^{3} + 168 \, b \cos \left (f x + e\right )^{2} - 60 \, b}{\cos \left (f x + e\right )^{7}}}{420 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.56, size = 88, normalized size = 0.96 \begin {gather*} -\frac {420 \, a \cos \left (f x + e\right )^{7} \log \left (-\cos \left (f x + e\right )\right ) + 420 \, a \cos \left (f x + e\right )^{5} - 140 \, b \cos \left (f x + e\right )^{4} - 105 \, a \cos \left (f x + e\right )^{3} + 168 \, b \cos \left (f x + e\right )^{2} - 60 \, b}{420 \, f \cos \left (f x + e\right )^{7}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 1.14, size = 119, normalized size = 1.29 \begin {gather*} \begin {cases} \frac {a \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {a \tan ^{4}{\left (e + f x \right )}}{4 f} - \frac {a \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac {b \tan ^{4}{\left (e + f x \right )} \sec ^{3}{\left (e + f x \right )}}{7 f} - \frac {4 b \tan ^{2}{\left (e + f x \right )} \sec ^{3}{\left (e + f x \right )}}{35 f} + \frac {8 b \sec ^{3}{\left (e + f x \right )}}{105 f} & \text {for}\: f \neq 0 \\x \left (a + b \sec ^{3}{\left (e \right )}\right ) \tan ^{5}{\left (e \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 340 vs.
\(2 (84) = 168\).
time = 1.83, size = 340, normalized size = 3.70 \begin {gather*} \frac {420 \, a \log \left ({\left | -\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1 \right |}\right ) - 420 \, a \log \left ({\left | -\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} - 1 \right |}\right ) + \frac {1089 \, a + 64 \, b + \frac {8463 \, a {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {448 \, b {\left (\cos \left (f x + e\right ) - 1\right )}}{\cos \left (f x + e\right ) + 1} + \frac {28749 \, a {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {1344 \, b {\left (\cos \left (f x + e\right ) - 1\right )}^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + \frac {51555 \, a {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} - \frac {2240 \, b {\left (\cos \left (f x + e\right ) - 1\right )}^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}} + \frac {51555 \, a {\left (\cos \left (f x + e\right ) - 1\right )}^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} + \frac {4480 \, b {\left (\cos \left (f x + e\right ) - 1\right )}^{4}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{4}} + \frac {28749 \, a {\left (\cos \left (f x + e\right ) - 1\right )}^{5}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{5}} + \frac {8463 \, a {\left (\cos \left (f x + e\right ) - 1\right )}^{6}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{6}} + \frac {1089 \, a {\left (\cos \left (f x + e\right ) - 1\right )}^{7}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{7}}}{{\left (\frac {\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 1\right )}^{7}}}{420 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.79, size = 227, normalized size = 2.47 \begin {gather*} \frac {2\,a\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\right )}{f}-\frac {2\,a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{12}-14\,a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{10}+\left (32\,a+\frac {32\,b}{3}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8+\left (\frac {16\,b}{3}-32\,a\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6+\left (14\,a+\frac {16\,b}{5}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+\left (-2\,a-\frac {16\,b}{15}\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+\frac {16\,b}{105}}{f\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{14}-7\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{12}+21\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^{10}-35\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^8+35\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^6-21\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^4+7\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2-1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________